package gussfist.game;

import java.util.Scanner;

/*
玩家类
 */
public class Player extends Role {
    @Override
    public void generateNumbers() {
        Scanner scan = new Scanner(System.in);
        int number = 0;
        System.out.println("请输入1-3的数，1是：石头，2是：剪刀，3是：布");
        while (true) {
            try {
                number = scan.nextInt();
                if (number <= 0 || number > 3) {
                    System.out.println("输入数字大小不对，请重新输入");
                    continue;
                }
                break;
            } catch (Exception e) {
                System.out.println("请输入数字");
                scan.next();
            }
        }
        this.setNumber(number);
    }
}
